i = netif->tx.req_cons;
rmb(); /* Ensure that we see the request before we copy it. */
memcpy(&txreq, RING_GET_REQUEST(&netif->tx, i), sizeof(txreq));
+
/* Credit-based scheduling. */
if (txreq.size > netif->remaining_credit) {
unsigned long now = jiffies;
msecs_to_jiffies(netif->credit_usec / 1000);
/* Timer could already be pending in rare cases. */
- if (timer_pending(&netif->credit_timeout))
- break;
+ if (timer_pending(&netif->credit_timeout)) {
+ netif_put(netif);
+ continue;
+ }
/* Passed the point where we can replenish credit? */
if (time_after_eq(now, next_credit)) {
tx_credit_callback;
__mod_timer(&netif->credit_timeout,
next_credit);
- break;
+ netif_put(netif);
+ continue;
}
}
netif->remaining_credit -= txreq.size;